package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the ABONO database table.
 * 
 */
@Entity
@Table(name="ABONO")
public class Abono implements Serializable {
	private static final long serialVersionUID = 1L;
	private long abonoId;
	private String estado;
	private String fgCierre;
	private BigDecimal monto;
	private BigDecimal personaId;
	private String rcboAsoc;
	private String tipoAbono;
	private String tipoUsr;
	private String tipoVent;
	private String tpoPagVent;
	private Date tsCrea;
	private Date tsModi;
	private String usrCaja;
	private OficRegistral oficRegistral;
	private MediosPago mediosPago;
	private Movimiento movimiento;
	private Set<Comprobante> comprobantes;
	private Set<Extorno> extornos;
	private PagoBanco pagoBanco;
	private PagoCheque pagoCheque;
	private Set<PagoSolicitud> pagoSolicituds;

    public Abono() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ABONO_ID", unique=true, nullable=false)
	public long getAbonoId() {
		return this.abonoId;
	}

	public void setAbonoId(long abonoId) {
		this.abonoId = abonoId;
	}


	@Column(nullable=false, length=1)
	public String getEstado() {
		return this.estado;
	}

	public void setEstado(String estado) {
		this.estado = estado;
	}


	@Column(name="FG_CIERRE", length=1)
	public String getFgCierre() {
		return this.fgCierre;
	}

	public void setFgCierre(String fgCierre) {
		this.fgCierre = fgCierre;
	}


	@Column(nullable=false, precision=12, scale=2)
	public BigDecimal getMonto() {
		return this.monto;
	}

	public void setMonto(BigDecimal monto) {
		this.monto = monto;
	}


	@Column(name="PERSONA_ID")
	public BigDecimal getPersonaId() {
		return this.personaId;
	}

	public void setPersonaId(BigDecimal personaId) {
		this.personaId = personaId;
	}


	@Column(name="RCBO_ASOC", length=15)
	public String getRcboAsoc() {
		return this.rcboAsoc;
	}

	public void setRcboAsoc(String rcboAsoc) {
		this.rcboAsoc = rcboAsoc;
	}


	@Column(name="TIPO_ABONO", nullable=false, length=1)
	public String getTipoAbono() {
		return this.tipoAbono;
	}

	public void setTipoAbono(String tipoAbono) {
		this.tipoAbono = tipoAbono;
	}


	@Column(name="TIPO_USR", length=1)
	public String getTipoUsr() {
		return this.tipoUsr;
	}

	public void setTipoUsr(String tipoUsr) {
		this.tipoUsr = tipoUsr;
	}


	@Column(name="TIPO_VENT", length=1)
	public String getTipoVent() {
		return this.tipoVent;
	}

	public void setTipoVent(String tipoVent) {
		this.tipoVent = tipoVent;
	}


	@Column(name="TPO_PAG_VENT", length=2)
	public String getTpoPagVent() {
		return this.tpoPagVent;
	}

	public void setTpoPagVent(String tpoPagVent) {
		this.tpoPagVent = tpoPagVent;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_CREA", nullable=false)
	public Date getTsCrea() {
		return this.tsCrea;
	}

	public void setTsCrea(Date tsCrea) {
		this.tsCrea = tsCrea;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="TS_MODI", nullable=false)
	public Date getTsModi() {
		return this.tsModi;
	}

	public void setTsModi(Date tsModi) {
		this.tsModi = tsModi;
	}


	@Column(name="USR_CAJA", length=15)
	public String getUsrCaja() {
		return this.usrCaja;
	}

	public void setUsrCaja(String usrCaja) {
		this.usrCaja = usrCaja;
	}


	//bi-directional many-to-one association to OficRegistral
    @ManyToOne
	@JoinColumns({
		@JoinColumn(name="OFIC_REG_ID", referencedColumnName="OFIC_REG_ID", nullable=false),
		@JoinColumn(name="REG_PUB_ID", referencedColumnName="REG_PUB_ID", nullable=false)
		})
	public OficRegistral getOficRegistral() {
		return this.oficRegistral;
	}

	public void setOficRegistral(OficRegistral oficRegistral) {
		this.oficRegistral = oficRegistral;
	}
	

	//bi-directional many-to-one association to MediosPago
    @ManyToOne
	@JoinColumn(name="MEDIO_ID")
	public MediosPago getMediosPago() {
		return this.mediosPago;
	}

	public void setMediosPago(MediosPago mediosPago) {
		this.mediosPago = mediosPago;
	}
	

	//bi-directional many-to-one association to Movimiento
    @ManyToOne
	@JoinColumn(name="MOVIMIENTO_ID", nullable=false)
	public Movimiento getMovimiento() {
		return this.movimiento;
	}

	public void setMovimiento(Movimiento movimiento) {
		this.movimiento = movimiento;
	}
	

	//bi-directional many-to-one association to Comprobante
	@OneToMany(mappedBy="abono")
	public Set<Comprobante> getComprobantes() {
		return this.comprobantes;
	}

	public void setComprobantes(Set<Comprobante> comprobantes) {
		this.comprobantes = comprobantes;
	}
	

	//bi-directional many-to-one association to Extorno
	@OneToMany(mappedBy="abono")
	public Set<Extorno> getExtornos() {
		return this.extornos;
	}

	public void setExtornos(Set<Extorno> extornos) {
		this.extornos = extornos;
	}
	

	//bi-directional one-to-one association to PagoBanco
	@OneToOne(mappedBy="abono")
	public PagoBanco getPagoBanco() {
		return this.pagoBanco;
	}

	public void setPagoBanco(PagoBanco pagoBanco) {
		this.pagoBanco = pagoBanco;
	}
	

	//bi-directional one-to-one association to PagoCheque
	@OneToOne(mappedBy="abono")
	public PagoCheque getPagoCheque() {
		return this.pagoCheque;
	}

	public void setPagoCheque(PagoCheque pagoCheque) {
		this.pagoCheque = pagoCheque;
	}
	

	//bi-directional many-to-one association to PagoSolicitud
	@OneToMany(mappedBy="abono")
	public Set<PagoSolicitud> getPagoSolicituds() {
		return this.pagoSolicituds;
	}

	public void setPagoSolicituds(Set<PagoSolicitud> pagoSolicituds) {
		this.pagoSolicituds = pagoSolicituds;
	}
	
}